home *** CD-ROM | disk | FTP | other *** search
- *** 1.6 1992/03/08 17:48:29
- --- Changelog 1992/03/23 01:47:27
- ***************
- *** 46,48 ****
- --- 46,53 ----
- link in demangler
-
- ------------------------------- Patchlevel 5 ---------------------------
- +
- + gprof.c:: ++jrb
- + various fixes from the net. gprof -s should work better now.
- +
- + ------------------------------- Patchlevel 6 ---------------------------
- *** 1.7 1992/03/08 17:48:29
- --- PatchLev.h 1992/03/23 01:47:27
- ***************
- *** 1,4 ****
- ! #define PatchLevel "05"
-
- /*
- * the Patch Level above is to identify the version
- --- 1,4 ----
- ! #define PatchLevel "06"
-
- /*
- * the Patch Level above is to identify the version
- *** 1.6 1992/03/08 17:48:29
- --- gprof.c 1992/03/23 01:47:29
- ***************
- *** 73,78 ****
- --- 73,82 ----
- # endif
- #endif
-
- + #ifdef HAVE_SETITIMER
- + #include <sys/time.h>
- + #endif
- +
- #include "gmon.h"
- /* #include <nlist.h> */
-
- ***************
- *** 772,777 ****
- --- 776,787 ----
-
- char *name = '\0';
- int ind;
- + #ifndef atarist
- + long int syms_offset;
- + unsigned int syms_size;
- + long int strs_offset;
- + unsigned int strs_size;
- + #endif
-
- #ifdef atarist
- _malloczero(1);
- ***************
- *** 1082,1089 ****
- were called from, we fake it. Since this is only
- gonna be fed back into gprof, it doesn't matter */
- #ifndef atarist
- ! call_tmp.from=(p->value+FUDGE_FACTOR)-hdr.low;
- ! call_tmp.to=(t->sym_to->value+FUDGE_FACTOR)-hdr.low;
- #else
- call_tmp.from=(p->value+FUDGE_FACTOR)+hdr.low;
- call_tmp.to=(t->sym_to->value+FUDGE_FACTOR)+hdr.low;
- --- 1092,1101 ----
- were called from, we fake it. Since this is only
- gonna be fed back into gprof, it doesn't matter */
- #ifndef atarist
- ! call_tmp.from=p->value+FUDGE_FACTOR;
- ! call_tmp.to=t->sym_to->value+FUDGE_FACTOR;
- ! /* call_tmp.from=(p->value+FUDGE_FACTOR)-hdr.low;
- ! call_tmp.to=(t->sym_to->value+FUDGE_FACTOR)-hdr.low; */
- #else
- call_tmp.from=(p->value+FUDGE_FACTOR)+hdr.low;
- call_tmp.to=(t->sym_to->value+FUDGE_FACTOR)+hdr.low;
- ***************
- *** 2134,2140 ****
- }
- #endif /* atarist */
-
- ! /* Return the symbol which has the largest value less than VAL.
- Since the symbol vector is sorted by value, this is done
- with a binary search. */
-
- --- 2146,2152 ----
- }
- #endif /* atarist */
-
- ! /* Return the symbol which has the largest value less than or equal to VAL.
- Since the symbol vector is sorted by value, this is done
- with a binary search. */
-
- ***************
- *** 2149,2155 ****
- if (m->value>val) {
- m-=gap;
- gap/=2;
- ! } else if ((m+1)->value<val) {
- m+=gap;
- gap/=2;
- } else
- --- 2161,2168 ----
- if (m->value>val) {
- m-=gap;
- gap/=2;
- ! } else if ((m+1)->value<=val) { /* *********** TEST ********* */
- ! /* } else if ((m+1)->value<val) { */
- m+=gap;
- gap/=2;
- } else
- ***************
- *** 2169,2174 ****
- --- 2182,2188 ----
- int
- badsym FUN1(struct nlist *, sym)
- {
- + int local;
- #ifndef N_SECT
- if ((sym->n_type & ~N_EXT) != N_TEXT)
- return TRUE;
- ***************
- *** 2176,2185 ****
- if ((sym->n_type & ~N_EXT) != N_TEXT && (sym->n_type & ~N_EXT) != N_SECT)
- return TRUE;
- #endif
- ! if (no_locals && !(sym->n_type&N_EXT))
- return TRUE;
- /* Filenames or pascal labels should be ignored */
- ! if (index (sym->n_un.n_name, '.') || index (sym->n_un.n_name, '$'))
- return TRUE;
- return FALSE;
- }
- --- 2190,2206 ----
- if ((sym->n_type & ~N_EXT) != N_TEXT && (sym->n_type & ~N_EXT) != N_SECT)
- return TRUE;
- #endif
- ! local = !(sym->n_type&N_EXT);
- ! if (no_locals && !local)
- return TRUE;
- /* Filenames or pascal labels should be ignored */
- ! if (local
- ! && (index (sym->n_un.n_name, '.')
- ! || index (sym->n_un.n_name, '$')
- ! #ifndef nounderscore
- ! || sym->n_un.n_name[0] != '_'
- ! #endif
- ! ))
- return TRUE;
- return FALSE;
- }
- ***************
- *** 2410,2415 ****
- --- 2431,2455 ----
- fputs (blurb, stdout);
- }
-
- + #ifdef HAVE_SETITIMER
- +
- + get_ticks()
- + {
- + struct itimerval tim;
- +
- + tim.it_interval.tv_sec = 0;
- + tim.it_interval.tv_usec = 1;
- + timerclear(&tim.it_value);
- + if (setitimer(ITIMER_REAL, &tim, 0) < 0
- + || setitimer(ITIMER_REAL, 0, &tim) < 0) {
- + fprintf(stderr, "%s: setitimer: ", myname);
- + perror((char *)0);
- + exit(1);
- + }
- + return 1000000/tim.it_interval.tv_usec;
- + }
- +
- + #else /* not HAVE_SETITIMER */
-
- /* Find the number of clock ticks/second by reading the kernel's memory.
- This means that if /dev/kmem isn't readable, this program will have to run
- ***************
- *** 2446,2452 ****
- PRINT_OBNOXIOUS_DEBUG_MESSAGE (DB_MISC, ("get_ticks ()=%ld", ret));
- return ret;
- }
- !
-
- /* Record one -e, -E, -f or -F option in `filters', and check for conflicts.
- All these options are recorded there for processing later
- --- 2486,2492 ----
- PRINT_OBNOXIOUS_DEBUG_MESSAGE (DB_MISC, ("get_ticks ()=%ld", ret));
- return ret;
- }
- ! #endif /* not HAVE_SETITIMER */
-
- /* Record one -e, -E, -f or -F option in `filters', and check for conflicts.
- All these options are recorded there for processing later
-